package com.erdos.hyt.mall.controller;

import com.erdos.hyt.base.model.HytResponse;
import com.erdos.hyt.mall.model.MallMember;
import com.erdos.hyt.mall.service.MallMemberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * Created by Administrator on 2017/4/5.
 */
@Api(value = "MallMemberController API")
@RestController
@RequestMapping(value = "/mall")
public class MallMemberController {

    @Autowired
    MallMemberService memberService;

    @ApiOperation(value="添加商城会员", notes="添加商城会员",httpMethod ="POST", response = HytResponse.class)
    @RequestMapping(value = "/memberAdd", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public HytResponse addMember(
            @ApiParam(value="品牌名称", required = true)
            @RequestParam(value = "userId", required = true) int userId,
            @ApiParam(value="登录时间", required = false)
            @RequestParam(value = "loginTime", required = true) LocalDateTime loginTime,
            @ApiParam(value="消费等级", required = false)
            @RequestParam(value = "consumeLevel", required = true) String consumeLevel,
            @ApiParam(value="累计消费金额", required = false)
            @RequestParam(value = "totalCost", required = true) BigDecimal totalCost,
            @ApiParam(value="最近消费时间", required = false)
            @RequestParam(value = "lastBuyTime", required = true) String lastBuyTime,
            @ApiParam(value="备注", required = false)
            @RequestParam(value = "memo", required = true) String memo){

        return null;
    }

    @ApiOperation(value="查询商城会员", notes="查询商城会员",httpMethod ="GET", response = HytResponse.class)
    @RequestMapping(value = "/memberQuery", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public HytResponse getMemberByCondition(){

        return null;
    }

    @ApiOperation(value="查询商城会员", notes="查询商城会员",httpMethod ="GET", response = HytResponse.class)
    @RequestMapping(value = "/memberDetail", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public HytResponse<MallMember> getMemberById(
            @ApiParam(value="会员id", required = true)
            @RequestParam(value = "memberId", required = true) int memberId){

        return null;
    }
}
